/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package miscelania.tiposgenericos;

import java.util.Iterator;
import java.util.LinkedList;

/**
 *
 * @author Christian
 */
public class PersonaLinkedList {
    public static void main(String[] args){
        // crear una lista de personas utilizando linkedlist
        LinkedList<Persona> lista = new LinkedList<Persona>();
        
        
        
        lista.add(new Persona("c",5));
        lista.add(new Persona("a",8));
        lista.add(new Persona("a",12));
        lista.add(new Persona("a",9));
        
        
        Iterator iterator;
        iterator  = lista.iterator(); 
        while (iterator.hasNext()){
        System.out.print(iterator.next()+" ");  
        }
        
        
        System.out.println(lista);
    }
}
